package com.anan.mapper;

import com.anan.pojo.domain.ProductDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author anan
 * @date 2023/05/08/08:52
 **/
@Mapper
public interface ProductMapper {
    boolean addProductDOs(ProductDO productDO);

    /**
     * 添加商品并获得主键
     */
    boolean addProductDOsGetKeyId(ProductDO productDO);

    List<ProductDO> getProductByStudentId(Integer studentId);

    List<ProductDO> getAllProducts(Integer status, Integer adminStatus, Integer buyStatus);
    List<ProductDO> getProductsByIdAndStatus(Integer studentId, Integer status, Integer adminStatus);

    boolean updateAdminStatus(Integer productId, Integer adminStatus);

    boolean updateBuyStatus(Integer buyStatus, Integer productId);

    ProductDO getProductById(Integer productId);

    List<ProductDO> getProductByLike(String title, Integer adminStatus, Integer status, Integer buyStatus);

    boolean updateShelvesStatus(Integer productId, Integer status);
}
